// Copyright (C) 2005 Taylor L. Riché <riche@cs.utexas.edu>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//  	$Id: Main.java 17 2005-06-29 05:02:51Z richetl $	
//

import antlr.collections.*;
import java.io.*;

class Main
{
    public static void main(String[] args) {

	try {
	    System.out.println("Welcome to the Langiappe Language Translator for " + 
			       System.getProperty("os.name") + "!");

	    // Read in filename from command line arguments
	    // and create lexer from input file

	    String filename = args[0];
	    BufferedReader in = new BufferedReader(new FileReader(filename));
	    LltLexer lexer = new LltLexer(in);

	    // Create parser object and parse the input

	    LltParser parser = new LltParser(lexer);
	    parser.compilation_unit();

	    // Get the AST generated by the parser and
	    // start translation

	    AST t = parser.getAST();
	    LltTreeParser translator = new LltTreeParser();
	    translator.compilation_unit(t);
	}
	catch (Exception e) {             
             System.err.println("Hello.");
             System.err.println(e);
        }
    }
}
